package com.blog.cloud.oss.controller;

import com.blog.cloud.oss.service.OssService;
import com.blog.cloud.core.utils.R;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
@RequiredArgsConstructor
@RequestMapping(value = "/oss")
public class OssController {

    private final OssService ossService;

    @GetMapping(value = "/aliyun/policy")
    public R<Object> generateProxy() {
        Map<String,String> policy = ossService.generatePolicy();
        return R.ok(policy);
    }
}

